package com.itown.expo.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;

import com.itown.expo.controller.base.MyBaseCommandController;
import com.itown.expo.model.EpidemicNotify;

public class EpidemicNotifyEditController extends MyBaseCommandController {

	@Override
	protected ModelAndView handleInner(HttpServletRequest request,
			HttpServletResponse response, Object command) {
		EpidemicNotify epidemicNotify = (EpidemicNotify) command;

		if (epidemicNotify.getId() == null) {
			// 新增
			epidemicNotify = getServiceContainer().getSettingService()
					.saveEpidemicNotify(epidemicNotify);
		} else {
			// 修改
			epidemicNotify = getServiceContainer().getSettingService()
					.updateEpidemicNotify(epidemicNotify);
		}
		return new ModelAndView(new RedirectView("EpidemicNotifySearch.do?id="
				+ epidemicNotify.getId()));
	}

}